/*
  * @file TxtFileReader.cpp
  * @author Thibault Merle et Guillaume Poussel
  */
#include <fstream>

#include "base/point_list.h"
#include "io/TxtFileReader.h"

point_list TxtFileReader::read_points() const {
    point_list points;
    std::ifstream in(_filename);
    if (!in) {
        return points;
    }
    p_type x, y;
    while ((in >> x >> y)) {
        points.push_back(new Point(x, y));
    }
    return points;
}
